<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<script type="text/javascript">
	function projectCategoryTree_onNodeClick(event, treeId, treeNode) {

		projectGrid.search({
			"field" : "treenode_path",
			"op" : "bw",
			"data" : treeNode.treenodePath
		});
	};
	function projectCategoryTree_onNodeClickFirst() {

	}
</script>

<section class="frame-main">
	<div id="dvFrameMainNav" class="frame-main-nav">
		<isperp:tree id="projectCategoryTree" modal="false">
			<isperp:async enable="true" url="project/category/getTree">
			</isperp:async>
			<isperp:callback onClick="projectCategoryTree_onNodeClick"
				onAsyncSuccess="projectCategoryTree_onNodeClickFirst();">
			</isperp:callback>
		</isperp:tree>

	</div>
	<section id="mainContent" class="frame-main-cont frame-main-cont-first"
		role="main">
		<div id="dvContainer">
			<isperp:grid gridId="projectGrid"
				url="project/project/library/libraryList"
				cusViewUrl="project/project/library/projectLibraryEdit"
				cusDialogSize="big" ondbClickRowEvent="projectGrid.view(rowid);">
				<jsp:attribute name="searchbar">
				<table class="search-table">
					<tbody>
						<tr>
							<td class="td1">项目编号：</td>
							<td class="td2"><input type="text" field="code" op="cn">
								</td>
							<td class="td1">项目名称：</td>
							<td class="td2"><input type="text" field="name" op="cn">
								</td>
							<td class="td1">客户：</td>
							<td class="td2"><input type="text" field="cusCustomerName"
									op="cn">
							</td>
						</tr>
						<tr>
							<td class="td1">项目经理：</td>
							<td><input type="text" field="managerName" op="cn">
							</td>
							<td class="td1">销售：</td>
							<td class="td2"><input type="text" field="sellerName"
									op="cn">
								</td>
							<td class="td1">合同编号：</td>
							<td class="td2"><input type="text" field="contractNo"
									op="cn">
								</td>
						</tr>
						<tr>
							<td class="td1">开始时间：</td>
							<td class="td2"><input id="startDateStart" type="date"
									field="startDate" op="gt" style="width: 68px" />~<input
									id="startDateEnd" type="date" field="startDate" op="lt"
									style="width: 68px" />
								</td>
							<td class="td1">结束时间：</td>
							<td class="td2" colspan="3"><input id="endDateStart"
									type="date" field="endDate" op="gt" style="width: 68px" />~<input
									id="endDateDateEnd" type="date" field="endDate" op="lt"
									style="width: 68px" />
								</td>
						</tr>
					</tbody>
				</table>
				</jsp:attribute>
				<jsp:body> 

				<isperp:column name="id" title="id" hidden="true"></isperp:column>
				<%-- <isperp:column name="project_level" title="" width="28"
						isFormatterFun="true"
						formatter="return statusFormatter(cellvalue);">
				</isperp:column> --%>
				<isperp:column name="code" title="项目编号" width="100">
				</isperp:column>
				<isperp:column name="name" title="项目名称" width="160">
				</isperp:column>
				<isperp:column name="account" title="项目金额(元)" width="80">
				</isperp:column>
				<isperp:column name="status" title="状态" width="60">
				</isperp:column>
				<isperp:column name="start_date" title="开始时间" width="80">
				</isperp:column>
				<isperp:column name="end_date" title="结束时间" width="80">
				</isperp:column>
				</jsp:body>
			</isperp:grid>


			<isperp:operate code="PROJ_HISTORY"></isperp:operate>
		</div>
	</section>

</section>
<script type="text/javascript">
	function statusFormatter(cellvalue) {
		if (cellvalue == 'A级')
			return "<img title='A级项目' src='img/project/pa.png'>";
		else if (cellvalue == 'B级')
			return "<img title='B级项目' src='img/project/pb.png'>";
		else if (cellvalue == 'C级')
			return "<img title='C级项目' src='img/project/pc.png'>";
		else if (cellvalue == 'D级')
			return "<img title='D级项目' src='img/project/pd.png'>";
		else if (cellvalue == 'E级')
			return "<img title='E级项目' src='img/project/pe.png'>";
	}
</script>